package components.validators
{
	import mx.validators.EmailValidator;
	
	import framework.LangMgr;
	
	import interfaces.IValidation;
	
	public class BaseEmailValidator extends EmailValidator
	{
		public function BaseEmailValidator()
		{
			super();
			invalidCharError = LangMgr.getResourceByLocaleKey("validate.invalidCharError");
			invalidDomainError = LangMgr.getResourceByLocaleKey("validate.invalidDomainError");
			invalidIPDomainError = LangMgr.getResourceByLocaleKey("validate.invalidIPDomainError");
			invalidPeriodsInDomainError = LangMgr.getResourceByLocaleKey("validate.invalidPeriodsInDomainError");
			missingAtSignError = LangMgr.getResourceByLocaleKey("validate.missingAtSignError");
			missingPeriodInDomainError = LangMgr.getResourceByLocaleKey("validate.missingPeriodInDomainError");
			missingUsernameError = LangMgr.getResourceByLocaleKey("validate.missingUsernameError");
			requiredFieldError = LangMgr.getResourceByLocaleKey("validate.requiredFieldError");
			tooManyAtSignsError = LangMgr.getResourceByLocaleKey("validate.tooManyAtSignsError");
		}
		
		override public function initialized(document:Object, id:String):void
		{
			super.initialized(document, id);
			var validation:IValidation = document as IValidation;
			if(validation)
				validation.pushValidator(this);
		}
	}
}